package com.test.p11flyweight.example01;

/**
 * 具体享元角色类
 */
public class ConcreteFlyweight extends Flyweight {
    public ConcreteFlyweight(Character  intrinsicState) {
        super(intrinsicState);
    }
    /**
     * 外蕴状态作为参数传入方法中，改变方法的行为，
     * 但是并不改变对象的内蕴状态。
     */
    @Override
    public void operation(String state) {
        System.out.println("Intrinsic State = " + this.getIntrinsicState());
        System.out.println("Extrinsic State = " + state);
    }

}
